package com.xxxx.web.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xxxx.web.dto.*;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;

/**
 * 库存流水记录表表
 */
@Data
@TableName("`InventoryRuningRecord`")
public class InventoryRuningRecord extends BaseEntity {


    /**
     * 库位
     */
    @JsonProperty("WarehouseBinId")
    @TableField(value = "WarehouseBinId", updateStrategy = FieldStrategy.IGNORED)
    private Integer WarehouseBinId;

    /**
     * 类型
     */
    @JsonProperty("Type")
    @TableField(value = "Type", updateStrategy = FieldStrategy.IGNORED)
    private String Type;

    /**
     * 商品
     */
    @JsonProperty("CargoId")
    @TableField(value = "CargoId", updateStrategy = FieldStrategy.IGNORED)
    private Integer CargoId;

    /**
     * 仓库
     */
    @JsonProperty("WarehouseId")
    @TableField(value = "WarehouseId", updateStrategy = FieldStrategy.IGNORED)
    private Integer WarehouseId;

    /**
     * 货主
     */
    @JsonProperty("CustomerId")
    @TableField(value = "CustomerId", updateStrategy = FieldStrategy.IGNORED)
    private Integer CustomerId;

    /**
     * 变动数量
     */
    @JsonProperty("Qty")
    @TableField(value = "Qty", updateStrategy = FieldStrategy.IGNORED)
    private Double Qty;

    /**
     * 关联单号
     */
    @JsonProperty("RelativeNo")
    @TableField(value = "RelativeNo", updateStrategy = FieldStrategy.IGNORED)
    private String RelativeNo;

    /**
     * 把库存流水记录表实体转换成库存流水记录表传输模型
     */
    public InventoryRuningRecordDto MapToDto() throws InvocationTargetException, IllegalAccessException {
        InventoryRuningRecordDto InventoryRuningRecordDto = new InventoryRuningRecordDto();

        BeanUtils.copyProperties(InventoryRuningRecordDto, this);

        return InventoryRuningRecordDto;
    }

}
